:root {
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #818cf8;
  --secondary-color: #4b5563;
  --accent-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;

  --text-primary: #ffffff;
  --text-secondary: #d1d5db;
  --text-muted: #a1a8b5;
  --text-dark: #374151;

  --surface-dark: #1f2937;
  --surface-darker: #111827;
  --surface-light: #374151;
  --surface-card: #1e293b;

  --glass-border: rgba(255, 255, 255, 0.1);
  --glass-bg: rgba(255, 255, 255, 0.05);
  --glass-filter: blur(20px) saturate(180%);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-xl: 0 16px 48px rgba(0, 0, 0, 0.5);

  --font-display: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-body: "Inter", "Segoe UI", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;

  --border-radius-sm: 6px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;

  --transition-fast: 0.2s ease;
  --transition-smooth: 0.3s ease;
  --transition-slow: 0.5s ease;

  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 1.5rem;
  --spacing-xl: 2rem;
  --spacing-2xl: 3rem;
  --spacing-3xl: 4rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  background: linear-gradient(
    135deg,
    var(--surface-darker) 0%,
    var(--surface-dark) 50%,
    #0f172a 100%
  );
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Header */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: var(--glass-filter);
  -webkit-backdrop-filter: var(--glass-filter);
  border-bottom: 1px solid var(--glass-border);
  z-index: 1000;
  transition: all var(--transition-smooth);
}

header.scrolled {
  background: rgba(15, 23, 42, 0.95);
  box-shadow: var(--shadow-md);
}

.header-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--spacing-md) var(--spacing-xl);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  position: relative;
  z-index: 1;
}

.logo::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-light)
  );
  transition: width var(--transition-smooth);
}

.logo:hover::after {
  width: 100%;
}

.logo span {
  color: var(--primary-color);
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.3);
}

/* Navigation */
nav ul {
  display: flex;
  flex-direction: column;
  list-style: none;
  padding: 1.5rem;
  gap: 0.5rem;
  margin: 0;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  min-height: 56px;
  font-size: 1rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--surface-dark);
  color: var(--text-primary);
  transform: translateX(8px);
  border-color: var(--primary-color);
}

.nav-link i {
  font-size: 1.2rem;
  width: 20px;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--border-radius-md);
  background: var(--glass-bg);
  transition: all var(--transition-smooth);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
  background: rgba(255, 255, 255, 0.15);
}

.menu-toggle span {
  width: 28px;
  height: 3px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
  transform-origin: center;
  position: relative;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
  width: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 100px auto var(--spacing-xl);
  padding: 0 var(--spacing-xl);
}

.section-header {
  text-align: center;
  margin-bottom: var(--spacing-3xl);
  position: relative;
}

.section-header::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 200px;
  height: 200px;
  background: radial-gradient(
    circle,
    rgba(99, 102, 241, 0.1) 0%,
    transparent 70%
  );
  transform: translate(-50%, -50%);
  z-index: -1;
}

.section-header h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text-primary);
  background: linear-gradient(
    135deg,
    var(--text-primary),
    var(--primary-light)
  );
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: var(--spacing-sm);
}

.section-line {
  width: 80px;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-light)
  );
  margin: var(--spacing-sm) auto;
  border-radius: 2px;
  position: relative;
  overflow: hidden;
}

.section-line:hover::after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left var(--transition-fast);
  left: 100%;
}

/* Project Content */
.project-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--spacing-3xl);
  align-items: start;
}

.project-image {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-lg);
}

.project-image::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(1, 102, 241, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: 1;
}

.project-image:hover::before {
  opacity: 1;
}

.project-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform var(--transition-slow);
  display: block;
}

.project-image:hover img {
  transform: scale(1.05);
}

.project-description {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-lg);
  padding: var(--spacing-md);
}

.project-description h3 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  position: relative;
  padding-bottom: var(--spacing-sm);
}

.project-description h3::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 2px;
}

.project-description p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  line-height: 1.8;
  text-align: justify;
}

.project-meta {
  display: flex;
  flex-direction: column;
  gap: var(--spacing-sm);
  padding: var(--spacing-md);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  backdrop-filter: var(--glass-filter);
}

.project-meta span {
  color: var(--text-muted);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: var(--spacing-sm);
}

.project-meta span i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.project-description ul {
  list-style: none;
  padding: 0;
  color: var(--text-secondary);
}

.project-description ul li {
  margin-bottom: var(--spacing-sm);
  padding-left: var(--spacing-lg);
  position: relative;
}

.project-description ul li::before {
  content: "▶";
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-size: 0.8rem;
}

/* Screenshot Gallery */
.screenshot-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--spacing-lg);
  margin-top: var(--spacing-xl);
  padding: var(--spacing-md);
}

.screenshot-item {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-lg);
  background: var(--surface-card);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-smooth);
}

.screenshot-item:hover,
.screenshot-item:focus-within {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.screenshot-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, transparent, rgba(99, 102, 241, 0.1));
  opacity: 0;
  transition: opacity var(--transition-smooth);
  z-index: 1;
}

.screenshot-item:hover::before,
.screenshot-item:focus-within::before {
  opacity: 1;
}

.screenshot-item img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: transform var(--transition-slow);
  display: block;
}

.screenshot-item:hover img,
.screenshot-item:focus-within img {
  transform: scale(1.1);
}

.screenshot-item p {
  background: var(--surface-card);
  padding: var(--spacing-lg);
  margin: 0;
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.6;
  border-top: 1px solid var(--glass-border);
  text-align: justify;
}

/* Buttons */
.project-links {
  display: flex;
  gap: var(--spacing-md);
  flex-wrap: wrap;
  margin-top: var(--spacing-lg);
}

.project-links .btn {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-md) var(--spacing-lg);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-hover)
  );
  color: var(--text-primary);
  text-decoration: none;
  border-radius: var(--border-radius-md);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all var(--transition-smooth);
  position: relative;
  overflow: hidden;
  border: none;
  cursor: pointer;
}

.project-links .btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left var(--transition-smooth);
}

.project-links .btn:hover::before,
.project-links .btn:focus-visible::before {
  left: 100%;
}

.project-links .btn:hover,
.project-links .btn:focus-visible {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.project-links .btn.secondary {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.project-links .btn.secondary:hover,
.project-links .btn.secondary:focus-visible {
  background: var(--primary-color);
  color: var(--text-primary);
}

/* Footer */
footer {
  background: linear-gradient(
    135deg,
    var(--surface-dark),
    var(--surface-darker)
  );
  padding: var(--spacing-3xl) var(--spacing-xl);
  text-align: center;
  border-top: 1px solid var(--glass-border);
  margin-top: var(--spacing-1xl);
  position: relative;
}

footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-color),
    transparent
  );
}

.footer-text p {
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.footer-content p:nth-child(2) {
  color: var(--primary-color);
  font-weight: 600;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-x0.5);
  margin-top: var(--spacing-lg);
  flex-wrap: wrap;
}

.footer-links a i {
  font-size: 1.5rem;
  transition: color var(--transition-smooth), transform var(--transition-fast);
}

.footer-links a:hover i {
  color: var(--primary-color);
  transform: translateY(-2px);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.95rem;
  padding: var(--spacing-sm) var(--spacing-md);
  border-radius: var(--border-radius-sm);
  transition: all var(--transition-smooth);
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--primary-color);
  background: var(--glass-bg);
  transform: translateY(-2px);
}

/* Animations */
.fade-in {
  opacity: 0;
  transform: translateY(30px);
  transition: all var(--transition-slow);
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-50px);
  transition: all var(--transition-slow);
}

.slide-in-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(50px);
  transition: all var(--transition-slow);
}

.slide-in-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
  transition: all var(--transition-slow);
}

.scale-in.visible {
  opacity: 1;
  transform: scale(1);
}

/* Loading Animation */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--glass-border);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--surface-darker);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-hover)
  );
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(
    135deg,
    var(--primary-hover),
    var(--primary-color)
  );
}

/* Selection */
::selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

::-moz-selection {
  background: rgba(99, 102, 241, 0.3);
  color: var(--text-primary);
}

/* Focus States */
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Media Queries */
@media (max-width: 768px) {
  :root {
    --container-padding: 1rem;
    --section-padding: 3rem 0;
  }

  /* Header Navigation */
  .header-content {
    height: 70px;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #0f172a;
  }

  .logo {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    color: var(--text-primary, #e2e8f0);
    z-index: 1000;
  }

  .logo span {
    color: var(--primary-color, #00c4ff);
  }

  .menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 1000;
    padding: 5px;
  }

  .menu-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
  }

  .menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-primary, #e2e8f0);
    border-radius: 1px;
    transition: all 0.3s ease;
    position: relative;
  }

  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }

  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }

  nav {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(20px);
    transform: translateY(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-bottom: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }

  nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  nav ul {
    display: flex;
    flex-direction: column;
    list-style: none;
    padding: 1.5rem;
    gap: 0.5rem;
    margin: 0;
  }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    background: var(--glass-bg, rgba(255, 255, 255, 0.1));
    border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.2));
    min-height: 56px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
  }

  .nav-link:hover,
  .nav-link.active {
    background: var(--surface-dark, #1e293b);
    color: var(--text-primary, #e2e8f0);
    transform: translateX(8px);
    border-color: var(--primary-color, #00c4ff);
  }

  .nav-link i {
    font-size: 1.2rem;
    width: 20px;
  }

  /* Additional responsive improvements */
  .project-content {
    grid-template-columns: 1fr;
    gap: var(--spacing-xl);
  }

  .project-image img {
    height: 300px;
  }

  .screenshot-gallery {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .screenshot-item img {
    height: 180px;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .project-description h3 {
    font-size: 1.5rem;
  }

  .project-links {
    justify-content: center;
  }

  .footer-links {
    gap: var(--spacing-md);
  }
}

@media (min-width: 769px) {
  .menu-toggle {
    display: none;
  }

  nav {
    position: static;
    transform: none;
    background: transparent;
    backdrop-filter: none;
    border: none;
    opacity: 1;
    visibility: visible;
    max-height: none;
    overflow: visible;
  }

  nav ul {
    flex-direction: row;
    padding: 0;
    gap: 2rem;
  }

  .nav-link {
    justify-content: flex-start;
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    min-height: auto;
    font-size: 0.95rem;
  }

  .nav-link:hover,
  .nav-link.active {
    transform: translateY(-2px);
    background: var(--glass-bg);
    border: none;
  }

  .nav-link i {
    font-size: 1rem;
  }

  .hero-visual {
    display: flex;
    justify-content: center;
    gap: 20px;
    padding: 0 20px;
  }

  .hero-card {
    width: 250px;
  }
}

@media (max-width: 480px) {
  :root {
    --container-padding: 0.75rem;
    --section-padding: 2rem 0;
  }

  /* Header */
  .header-content {
    height: 60px;
    padding: 0 0.75rem;
  }

  .logo h1 {
    font-size: 1.3rem;
  }

  .menu-toggle {
    width: 40px;
    height: 40px;
  }

  .menu-toggle span {
    width: 18px;
  }

  /* Navigation */
  nav {
    top: 60px;
    max-height: calc(100vh - 60px);
  }

  nav ul {
    padding: 1rem;
    gap: 0.5rem;
  }

  .nav-link {
    padding: 0.75rem 1rem;
    min-height: 48px;
    font-size: 0.9rem;
  }

  .project-image img {
    height: 250px;
  }

  .screenshot-gallery {
    grid-template-columns: 1fr;
    gap: var(--spacing-sm);
  }

  .screenshot-item img {
    height: 150px;
  }

  .project-links .btn {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
  }

  .section-header {
    margin-bottom: var(--spacing-xl);
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Print Styles */
@media print {
  * {
    background: transparent !important;
    color: black !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  header,
  footer,
  .menu-toggle,
  .project-links {
    display: none !important;
  }

  main {
    margin-top: 0 !important;
  }

  .project-content {
    grid-template-columns: 1fr !important;
  }
}
